
Use Tunga

GO
--Insert
CREATE PROC insertFood
	@[foodtypeid] int,
	@[name] nvarchar(100),
	@[price] float,
	@[persons] int,
	@[picture] nvarchar(500),
	@[descr] nvarchar(500),
	@[status] bit default(0)
AS
INSERT INTO  Food([foodtypeid],[name],[price],[persons],[picture],[descr],[status])
 VALUES(@[foodtypeid],@[name],@[price],@[persons],@[picture],@[descr],@[status])

GO
--update
CREATE PROC updateFood
	@[id] int,
	@[foodtypeid] int,
	@[name] nvarchar(100),
	@[price] float,
	@[persons] int,
	@[picture] nvarchar(500),
	@[descr] nvarchar(500),
	@[status] bit default(0)
AS
UPDATE Food SET	
	[foodtypeid] =@[foodtypeid],
	[name] =@[name],
	[price]=@[price],
	[persons] =@[persons],
	[picture] =@[picture],
	[descr] =@[descr],
	[status] =@[status]
WHERE 	[id] =@[id]
GO
--Delete
CREATE PROC deleteFood
	@[id] int
AS
	DELETE FROM Food WHERE [id]=@[id]
GO
--Get All Food
CREATE PROC getAllFood
AS
SELECT * from Food
GO
--get Food By ID
CREATE PROC getFoodByID
	@[id] int
AS
SELECT * from Food WHERE [id]=@[id]
GO


